package com.zhbr.mvp.ui.fragment;

import android.content.Context;
import android.view.View;
import android.widget.Button;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.zhbr.R;
import com.zhbr.adapter.OrderCardAdapter;
import com.zhbr.entity.TGdfwPqgd;
import com.zhbr.mvp.base.presenter.BasePresenter;
import com.zhbr.mvp.base.view.BaseFragment;

import java.util.ArrayList;
import java.util.List;

public class PageFragment4 extends BaseFragment  {
    RecyclerView recyclerView;
    LinearLayoutManager linearLayoutManager;
    OrderCardAdapter adapter;
    List<TGdfwPqgd> list=new ArrayList<TGdfwPqgd>();
    Button button;
    public static PageFragment4 getInstance() {
        PageFragment4 sf = new PageFragment4();
        return sf;
    }


    @Override
    protected BasePresenter createPresenter() {
        return null;
    }

    @Override
    public void getViewModel() {

    }

    @Override
    public Context getActivityContext() {
        return getContext();
    }

    @Override
    public int getContentView() {
        return R.layout.page_fragment;
    }

    @Override
    public void initView(View view) {
        recyclerView = view.findViewById(R.id.recyclerView);
//        button  = view.findViewById(R.id.btn_get_data);
    }

    @Override
    public void initData() {
        linearLayoutManager = new LinearLayoutManager(getActivity());
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(linearLayoutManager);
        TGdfwPqgd tGdfwPqgd = new TGdfwPqgd();
        tGdfwPqgd.setBxr("孟祥龙");
        tGdfwPqgd.setBxnr("Hello world!");
        tGdfwPqgd.setObjId("1231231231");
        list.add(tGdfwPqgd);
        adapter= new OrderCardAdapter(getContext(),list);
        recyclerView.setAdapter(adapter);
    }


}